#include "head.h"

int lsFunc(int sockfd) {
    int ifError;
    recv(sockfd, &ifError, sizeof(int), 0);
    if (ifError != 0) {
        // 接收一个小火车
        printf("ls is error\n");
        return -1;
    }

    int length;
    char buf[4096]={0};
    recvn(sockfd,&length,sizeof(length));
    recvn(sockfd,buf,length);
    printf("%s",buf);
    return 0;
}
